package com.bitcs.accesscontrol.util;

import com.alibaba.fastjson.JSON;

/**
 * @author GeChen
 * @Description
 * @date 2019/11/13 14:29
 */
public class ResponseUtil {
    private Integer code;
    private String message;
    private Object data;

    public static String getResponseString(Integer code, String message, Object data) {
        ResponseUtil response = new ResponseUtil();
        response.setCode(code);
        response.setMessage(message);
        response.setData(data);
        return JSON.toJSONString(response);
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return "ResponseUtil{" +
                "code=" + code +
                ", message='" + message + '\'' +
                ", data=" + data +
                '}';
    }
}
